feat(hris): bind Employment to employing legal organization - #141
feat(hris): bind Employment to employing legal organization#141seonghobae wants to merge 50 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughEmployment와 법적 고용 조직의 bitemporal 관계를 추가했습니다. API 요청과 권한 검사를 확장했습니다. People 및 confirmed-hire 저장 경로에서 active/leave 고용의 관계를 기록합니다. PostgreSQL 계약 테스트와 CI 검증을 추가했습니다. Changes고용주 관계 계약
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: 🟠 High · up to The PR adds authoritative employing-organization writes, but authorization evidence is not bound to the exact organization used at persistence, creating a potential same-tenant legal-employer substitution path across employment and hire flows. Required independent review and security-gate evidence is also incomplete, so the PR is not merge-ready. Sequence Diagram(s)sequenceDiagram
participant Client
participant PeopleAPI
participant Keyverse
participant PostgreSQL
Client->>PeopleAPI: 고용 또는 confirmed-hire 요청
PeopleAPI->>Keyverse: operation scope 및 target scope 평가
Keyverse-->>PeopleAPI: 인가 결정 반환
PeopleAPI->>PostgreSQL: Employment와 고용주 관계 저장
PostgreSQL-->>PeopleAPI: deferred 계약 검증 및 커밋
PeopleAPI-->>Client: 결과 반환
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 60.94% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 64 functions across 31 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head product diff. Coverage is a separate gate.
Changed files
.github/workflows/employment-employing-organization-quality.yml— GitHub Actions review jobCHANGELOG.md— repository behaviordatabase/migrations/0040_employment_employing_organization.sql— repository behaviordocs/API_CONTRACT.md— operator or user guidancedocs/DATA_MODEL.md— operator or user guidancedocs/ERD.md— operator or user guidancedocs/SECURITY.md— operator or user guidancedocs/TRACEABILITY.md— operator or user guidancedocs/adr/0141-employment-employing-organization.md— operator or user guidancedocs/adr/README.md— operator or user guidancedocs/doctoring/employment-employing-organization.md— operator or user guidancemanifest.json— repository behaviorpackage.json— repository behaviorpackages/keyverse-adapter/src/orgmetra_keyverse_adapter/authorization.py— Python module behaviorpackages/keyverse-adapter/tests/test_authorization.py— regression suitepackages/keyverse-adapter/tests/test_target_scope_denial_guidance.py— regression suiteschemas/openapi.yaml— repository behaviorscripts/foundation-contract-core.mjs— TypeScript or JavaScript runtimeservices/people-api/src/orgmetra_people_api/authorization.py— Python module behaviorservices/people-api/src/orgmetra_people_api/hire.py— Python module behaviorservices/people-api/src/orgmetra_people_api/hire_http.py— Python module behaviorservices/people-api/src/orgmetra_people_api/mutation_http.py— Python module behaviorservices/people-api/src/orgmetra_people_api/mutations.py— Python module behaviorservices/people-api/src/orgmetra_people_api/postgres_hire.py— Python module behaviorservices/people-api/src/orgmetra_people_api/postgres_mutations.py— Python module behaviorservices/people-api/tests/test_decision_reason_binding.py— regression suiteservices/people-api/tests/test_employing_organization_authorization_binding.py— regression suiteservices/people-api/tests/test_evidence_reference_binding_regression.py— regression suiteservices/people-api/tests/test_hire_acceptance.py— regression suiteservices/people-api/tests/test_hire_http_route.py— regression suiteservices/people-api/tests/test_hire_http_scalar_contract.py— regression suiteservices/people-api/tests/test_mutation_http_authentication_order.py— regression suiteservices/people-api/tests/test_mutation_http_route.py— regression suiteservices/people-api/tests/test_mutation_http_schema_types.py— regression suiteservices/people-api/tests/test_people_mutations.py— regression suiteservices/people-api/tests/test_postgres_hire_acceptance.py— regression suiteservices/people-api/tests/test_postgres_people_mutations.py— regression suiteservices/people-api/tests/test_review_regressions.py— regression suiteservices/people-api/tests/test_support_reference_correlation.py— regression suiteservices/people-api/tests/test_support_reference_response_privacy.py— regression suitetests/foundation-contract.test.mjs— regression suitetests/test_employment_employing_organization_postgres.sh— regression suitetests/test_operational_uuid_postgres.sh— regression suitetests/validate_repository.py— regression suite
Changed behavior
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: employment-employing-organization-quality.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: employment-employing-organization-quality.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Repository file: CHANGELOG.md"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: CHANGELOG.md"]
R2 --> V2["required checks"]
Evidence --> S3["Repository file: 0040_employment_employing_organization.sql"]
S3 --> I3["repository behavior"]
I3 --> R3["Review risk: Repository file: 0040_employment_employing_organization.sql"]
R3 --> V3["required checks"]
Evidence --> S4["Docs: API_CONTRACT.md (8 files)"]
S4 --> I4["operator or user guidance"]
I4 --> R4["Review risk: Docs: API_CONTRACT.md (8 files)"]
R4 --> V4["docs review"]
Evidence --> S5["Repository file: manifest.json"]
S5 --> I5["repository behavior"]
I5 --> R5["Review risk: Repository file: manifest.json"]
R5 --> V5["required checks"]
Evidence --> S6["Repository file: package.json"]
S6 --> I6["repository behavior"]
I6 --> R6["Review risk: Repository file: package.json"]
R6 --> V6["required checks"]
Evidence --> S7["Python: authorization.py (8 files)"]
S7 --> I7["Python module behavior"]
I7 --> R7["Review risk: Python: authorization.py (8 files)"]
R7 --> V7["pytest plus coverage"]
Evidence --> S8["Test: test_authorization.py (2 files)"]
S8 --> I8["regression suite"]
I8 --> R8["Review risk: Test: test_authorization.py (2 files)"]
R8 --> V8["targeted test run"]
Evidence --> S9["Repository file: openapi.yaml"]
S9 --> I9["repository behavior"]
I9 --> R9["Review risk: Repository file: openapi.yaml"]
R9 --> V9["required checks"]
Evidence --> S10["TypeScript/JavaScript: foundation-contract-core.mjs"]
S10 --> I10["TypeScript or JavaScript runtime"]
I10 --> R10["Review risk: TypeScript/JavaScript: foundation-contract-core.mjs"]
R10 --> V10["package test plus coverage"]
Evidence --> S11["Test: test_decision_reason_binding.py (15 files)"]
S11 --> I11["regression suite"]
I11 --> R11["Review risk: Test: test_decision_reason_binding.py (15 files)"]
R11 --> V11["targeted test run"]
Evidence --> S12["Test: foundation-contract.test.mjs (4 files)"]
S12 --> I12["regression suite"]
I12 --> R12["Review risk: Test: foundation-contract.test.mjs (4 files)"]
R12 --> V12["targeted test run"]
Findings
No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.
- Head SHA:
8d12ee7cd05549a69c6debf5e0de0c5fc8668f33 - Workflow run: 33242513434
- Workflow attempt: 1
- Coverage gate:
failure
Review outcome
Coverage is a gate, not the review. This body reviews the changed product files.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow: employment-employing-organization-quality.yml"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow: employment-employing-organization-quality.yml"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Repository file: CHANGELOG.md"]
S2 --> I2["repository behavior"]
I2 --> R2["Review risk: Repository file: CHANGELOG.md"]
R2 --> V2["required checks"]
Evidence --> S3["Repository file: 0040_employment_employing_organization.sql"]
S3 --> I3["repository behavior"]
I3 --> R3["Review risk: Repository file: 0040_employment_employing_organization.sql"]
R3 --> V3["required checks"]
Evidence --> S4["Docs: API_CONTRACT.md (8 files)"]
S4 --> I4["operator or user guidance"]
I4 --> R4["Review risk: Docs: API_CONTRACT.md (8 files)"]
R4 --> V4["docs review"]
Evidence --> S5["Repository file: manifest.json"]
S5 --> I5["repository behavior"]
I5 --> R5["Review risk: Repository file: manifest.json"]
R5 --> V5["required checks"]
Evidence --> S6["Repository file: package.json"]
S6 --> I6["repository behavior"]
I6 --> R6["Review risk: Repository file: package.json"]
R6 --> V6["required checks"]
Evidence --> S7["Python: authorization.py (8 files)"]
S7 --> I7["Python module behavior"]
I7 --> R7["Review risk: Python: authorization.py (8 files)"]
R7 --> V7["pytest plus coverage"]
Evidence --> S8["Test: test_authorization.py (2 files)"]
S8 --> I8["regression suite"]
I8 --> R8["Review risk: Test: test_authorization.py (2 files)"]
R8 --> V8["targeted test run"]
Evidence --> S9["Repository file: openapi.yaml"]
S9 --> I9["repository behavior"]
I9 --> R9["Review risk: Repository file: openapi.yaml"]
R9 --> V9["required checks"]
Evidence --> S10["TypeScript/JavaScript: foundation-contract-core.mjs"]
S10 --> I10["TypeScript or JavaScript runtime"]
I10 --> R10["Review risk: TypeScript/JavaScript: foundation-contract-core.mjs"]
R10 --> V10["package test plus coverage"]
Evidence --> S11["Test: test_decision_reason_binding.py (15 files)"]
S11 --> I11["regression suite"]
I11 --> R11["Review risk: Test: test_decision_reason_binding.py (15 files)"]
R11 --> V11["targeted test run"]
Evidence --> S12["Test: foundation-contract.test.mjs (4 files)"]
S12 --> I12["regression suite"]
I12 --> R12["Review risk: Test: foundation-contract.test.mjs (4 files)"]
R12 --> V12["targeted test run"]
OpenCode Review Overview
Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment. |
Buyer-visible HRIS core
This branch retains a valid Employment→employing legal Organization feature: one tenant-qualified, bitemporal legal-employer relationship is modeled independently from Position and Assignment, with correction-not-rewrite history, legal-entity classification, RLS/tenant integrity, and organization-specific authorization evidence. Payroll, withholding, compensation, statutory-account truth, and autonomous employment decisions remain out of scope.
Current repair state
This PR is now open · Draft · non-mergeable. Exact feature head remains
8d12ee7cd05549a69c6debf5e0de0c5fc8668f33. Its recorded base/evidence belongs to predecessordevelop@9e3e4847510e1e612b48474ba42b177b8ed824df, while current protecteddevelopiseb9757f8649aaad026a9865508d9aad50c1a7a4f. The old terminal GREEN feature checks and old OpenCode/Strix failures are historical evidence only; they are not current-base merge authorization.The branch was lowered to Draft rather than closed because its migration, API, authorization, tests, documentation, ADR, and employing-organization semantics remain valid delta that is not fully present on protected
develop.Single-writer reconciliation
#141 overlaps the active People owners on
schemas/openapi.yaml,hire.py,mutation_http.py,mutations.py,postgres_hire.py,postgres_mutations.py, and Keyverse authorization files. It must not overwrite those owners from this stale feature snapshot.Current canonical order is:
0.0000is invalid in domain/DB but still advertised by the published OpenAPI regex.No source copy from mutable sibling heads, destructive rebase, force-push, or early Ready transition. A future reconciliation must preserve #141 target-scope authorization and legal-employer semantics while also preserving the protected generic People/authorization invariants that land before it.
Historical feature evidence retained
Contract-first
4eb28864d563fbe9f090c729220b54b8701172acestablished the original missing-migration RED. Subsequent ordinary commits added migration0040, bitemporal/tenant/RLS constraints, application persistence, exact organization target-scope binding, manifest/provenance updates, documentation and tests. Test-only48de15641530cdaedbe384525e5b4aa3463cf965exposed the target-scope evidence-binding regression and the subsequent repair preservedrequired_target_scope_codeand enforced exact organization scope before persistence.These checks demonstrate validity of the feature delta on its historical exact head; they do not substitute for fresh checks/review after non-force adoption of current protected owner truth.
Merge gate
Not merge-ready. It requires protected-owner adoption/reconciliation, fresh exact-head Foundation/People/PostgreSQL/security workflows, zero unresolved review findings, and a qualifying independent approval. Do not self-approve, administrator-bypass, weaken required workflows, transfer predecessor evidence, or close the PR merely because its base is stale.